package com.somsoft.handjc.activity.query.xzsp;

import java.util.ArrayList;
import java.util.List;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.somsoft.handjc.activity.R;
import com.somsoft.handjc.util.BaseActivity;
import com.somsoft.handjc.util.MyApplication;
import com.somsoft.handjc.util.Utils;

public class XzspQueryMainActivity extends BaseActivity implements OnItemClickListener{

	private ListView listView; 
    @Override 
    public void onCreate(Bundle savedInstanceState){ 
        super.onCreate(savedInstanceState); 
        MyApplication.getInstance().addActivity(this);
        listView = new ListView(this); 
        listView.setAdapter(new ArrayAdapter<String>(this, R.layout.simple_list_item_1,getData())); 
        setContentView(listView); 
        setTitle("行政审批综合查询");
        listView.setOnItemClickListener(this);
        Utils.closeLoading();
    } 

    private List<String> getData(){ 
        List<String> data = new ArrayList<String>(); 
        data.add("综合时限查询");
        data.add("综合逻辑查询");
        data.add("综合异常结果查询");
        return data; 
    }

	@Override
	public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
		Intent it = null;
		switch (arg2) {
		case 0:
			it = new Intent(XzspQueryMainActivity.this,XzspSxQueryListActivity.class);
			break;
		case 1:
			it = new Intent(XzspQueryMainActivity.this,XzspLjQueryListActivity.class);
			break;
		case 2:
			it = new Intent(XzspQueryMainActivity.this,XzspYcQueryListActivity.class);
			break;
		default:
			break;
		}
		Utils.openLoading(XzspQueryMainActivity.this);
		startActivity(it);
	} 
}
